<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <style>
        .container {
            width: 500px;
            height: 500px;
            background-color: black;
            margin: auto;
        }

        .button {

            background-color: blue;
            height: 100px;
            width: 100px;
            margin: 100px 200px;
        }

        .name {
            color: yellow;
            margin: auto;
            text-align: center;
            width: 200px;
            height: 200px;
            font-size: 30px;
        }
    </style>
</head>

<body>

    <body>

        <div class="container">

            <div class="name"> 名字

            </div>

            <button class="button"> 继续匹配</button>
        </div>

    </body>

    <script>


        let list = ["而佛二分", "撒旦范德萨", "是地球上的", "案发时", "啊的撒范德萨", "大大", "safs"];
        let button = document.querySelector('.button');
        let name = document.querySelector('.name');
        let shouldClick = true;


        let list2 = [];

        button.addEventListener('click', () => {


            if (list.length != 0) {
                let b = Math.floor(Math.random() * list.length);
                name.innerHTML = list[b];

                list2.push(list[b]);
                //把刚刚的随机数从原数组里面删掉
                list.splice(b, 1);

                console.log(list2);


            }





        }



        );


    </script>

</body>

</html>